using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class enterRoom : MonoBehaviour
{
    public int myHost;
    public SaveParam SaveParam;
    
    // Start is called before the first frame update
    void Start()
    {
        GetComponent<Button>().onClick.AddListener(EnterRoom);
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    

    // 加入房间
    public void EnterRoom()
    {
        if(myHost==0)
            return;
        // 跳转场景
        SceneManager.LoadScene("双人房");
        // 保存端口
        SaveParam.Host=myHost;
    }

    // 退出房间
    public void OutRoom()
    {
        SceneManager.LoadScene("Start");
    }
}
